def Solve():
    d = {}
    d[   0] = ""
    d[   1] = "one"
    d[   2] = "two"
    d[   3] = "three"
    d[   4] = "four"
    d[   5] = "five"
    d[   6] = "six"
    d[   7] = "seven"
    d[   8] = "eight"
    d[   9] = "nine"
    d[  10] = "ten"
    d[  11] = "eleven"
    d[  12] = "twelve"
    d[  13] = "thirteen"
    d[  14] = "fourteen"
    d[  15] = "fifteen"
    d[  16] = "sixteen"
    d[  17] = "seventeen"
    d[  18] = "eighteen"
    d[  19] = "nineteen"
    d[  20] = "twenty"
    d[  30] = "thirty"
    d[  40] = "forty"
    d[  50] = "fifty"
    d[  60] = "sixty"
    d[  70] = "seventy"
    d[  80] = "eighty"
    d[  90] = "ninety"
    d[1000] = "onethousand"

    for i in xrange(1, 1000):
        if i not in d:
            # Handle number under 100
            if i < 100:
                d[i] = d[i - i%10] + d[i%10]

            # Handle hundred
            else:
                d[i] = d[i//100] + "hundred"
                if i % 100 != 0:
                    d[i] += "and" + d[i%100]

    return sum(len(s) for s in d.values())
